home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1984-04-24 | 28.8 KB | 1,153 lines |
- 10 DIM PE(1000),DOW$(7),MD(13),MOY$(12)
- 20 DEFDBL X
- 30 DEF FND(X)=MD(X)-MD(X-1)
- 40 PAT1$="$$#########.##"
- 50 PAT2$="####"
- 60 PAT3$="###.##"
- 70 PAT4$="##.#######"
- 80 PAT5$="######"
- 90 PAT6$="##"
- 100 IN1$="Present value, in dollars $ "
- 110 IN2$="Future value, in dollars $ "
- 120 IN3$="Annual interest rate, in % "
- 130 IN4$="Number of periods per year "
- 140 IN5$="Periodic payment, in dollars $ "
- 150 IN6$="Enter the time period "
- 160 IN7$="Initial loan amount, in dollars $ "
- 170 PR1$="What would you like to do next?"
- 180 PR2$="Enter your choice"
- 190 PR3$="Using the form YY,MM,DD (enter zero's if necessary)"
- 200 PR4$="Time period of"
- 210 PR5$="years"
- 220 PR6$="months and"
- 230 PR7$="days or"
- 240 PR8$="periods."
- 250 PR9$="Present value "
- 260 PR10$="Future value "
- 270 PR11$="Annual interest rate "
- 280 PR12$="Periods per year "
- 290 PR13$="Initial loan amount "
- 300 PR14$="Simple interest "
- 310 PR15$="Interest per period "
- 320 PR16$="Periodic payment "
- 330 CLS:KEY OFF:SCREEN 0,0,0:WIDTH 80
- 340 ON ERROR GOTO 690
- 350 PRINT "Enter the number of one of the following programs."
- 360 PRINT
- 370 PRINT " 1 - Present value of a future sum"
- 380 PRINT " 2 - Simple interest"
- 390 PRINT " 3 - Future value of a present sum"
- 400 PRINT " 4 - Amortization schedule"
- 410 PRINT " 5 - Interest rate for compound interest"
- 420 PRINT " 6 - Interest rate for installment loans"
- 430 PRINT " 7 - Date arithmetic"
- 440 PRINT " 8 - Term of an installment loan"
- 450 PRINT " 9 - Present value of series of payments"
- 460 PRINT " 10 - Real estate capital investment"
- 470 PRINT " 11 - Nominal and effective interest rates"
- 480 PRINT " 12 - Internal rate of return"
- 490 PRINT " 13 - Future value of regular deposits"
- 500 PRINT " 14 - Regular deposits for future value"
- 510 PRINT " 15 - Depreciation - amount"
- 520 PRINT " 16 - Depreciation - rate"
- 530 PRINT " 17 - Depreciation - salvage value"
- 540 PRINT " 18 - Depreciation - schedule"
- 550 PRINT " 19 - Bond - present value"
- 560 PRINT " 20 - Bond - yield to maturity"
- 570 PRINT
- 580 INPUT "Type program number (or space bar to exit) and press ENTER ",F
- 590 IF F=0 THEN CLS:ON ERROR GOTO 0:END
- 600 IF F<0 OR F>20 GOTO 640
- 610 CLS
- 620 C=0
- 630 ON F GOTO 1000,2000,3000,4000,5000,6000,7000,8000,9000,640,11000,12000,13000,14000,15000,16000,17000,640,19000,20000
- 640 CLS
- 650 PRINT "The program number you have selected (";F;") does not exist."
- 660 PRINT "Press any key to return to the main menu."
- 670 IF LEN(INKEY$)<1 GOTO 670
- 680 GOTO 330
- 690 CLS
- 700 PRINT "Error ";ERR;" has occurred on line # ";ERL
- 710 PRINT "Press any key to continue."
- 720 IF LEN(INKEY$)<1 GOTO 720
- 730 RESUME 630
- 1000 PRINT "This program calculates the present value of"
- 1010 PRINT "a future sum, discounting it for a particular"
- 1020 PRINT "interest rate, compounded as instructed."
- 1030 PRINT
- 1040 PRINT IN2$;:INPUT "",FV
- 1050 IF C=1 GOTO 1140
- 1060 PRINT IN3$;:INPUT "",AIR
- 1070 IF C=2 GOTO 1130
- 1080 PRINT IN4$;:INPUT "",NPPY
- 1090 IF C=3 GOTO 1120
- 1100 PRINT PR3$
- 1110 PRINT IN6$;:INPUT "",YY,MM,DD
- 1120 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 1130 IR=AIR/(100*NPPY)
- 1140 PV=FV*(1+IR)^(-NP)
- 1150 CLS
- 1160 PRINT PR10$;:PRINT USING PAT1$;FV
- 1170 PRINT PR11$;:PRINT USING PAT3$;AIR;:PRINT " %"
- 1180 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 1190 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 1200 PRINT
- 1210 COLOR 15,0
- 1220 PRINT PR9$;:PRINT USING PAT1$;PV
- 1230 COLOR 7,0
- 1240 PRINT
- 1250 PRINT PR1$
- 1260 PRINT
- 1270 PRINT "1 - Change future value"
- 1280 PRINT "2 - Change annual interest rate"
- 1290 PRINT "3 - Change number of periods per year"
- 1300 PRINT "4 - Change time period"
- 1310 PRINT "5 - Rerun using all new values"
- 1320 PRINT "6 - Return to main menu"
- 1330 PRINT
- 1340 PRINT PR2$
- 1350 C=VAL(INKEY$)
- 1360 IF C<1 OR C>6 GOTO 1350
- 1370 ON C GOTO 1040,1060,1080,1100,610,330
- 2000 PRINT "This routine calculates simple interest on"
- 2010 PRINT "dollars held in deposit for a specified period"
- 2020 PRINT "using a given percentage of interest."
- 2030 PRINT
- 2040 PRINT IN1$;:INPUT "",PV
- 2050 IF C=1 GOTO 2140
- 2060 PRINT IN3$;:INPUT "",AIR
- 2070 IF C=2 GOTO 2130
- 2080 PRINT IN4$;:INPUT "",NPPY
- 2090 IF C=3 GOTO 2120
- 2100 PRINT PR3$
- 2110 PRINT IN6$;:INPUT "",YY,MM,DD
- 2120 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 2130 IR=AIR/(100*NPPY)
- 2140 I=IR*NP*PV
- 2150 FV=PV+I
- 2160 CLS
- 2170 PRINT PR9$;:PRINT USING PAT1$;PV
- 2180 PRINT PR11$;:PRINT USING PAT3$;AIR;:PRINT " %"
- 2190 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 2200 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 2210 PRINT
- 2220 COLOR 15,0
- 2230 PRINT PR14$;:PRINT USING PAT1$;I
- 2240 PRINT PR15$;:PRINT USING PAT1$;I/NP
- 2250 PRINT PR10$;:PRINT USING PAT1$;FV
- 2260 COLOR 7,0
- 2270 PRINT
- 2280 PRINT PR1$
- 2290 PRINT
- 2300 PRINT "1 - Change present value"
- 2310 PRINT "2 - Change annual interest rate"
- 2320 PRINT "3 - Change number of periods per year"
- 2330 PRINT "4 - Change time period"
- 2340 PRINT "5 - Rerun using all new values"
- 2350 PRINT "6 - Return to main menu"
- 2360 PRINT
- 2370 PRINT PR2$
- 2380 C=VAL(INKEY$)
- 2390 IF C<1 OR C>6 GOTO 2380
- 2400 ON C GOTO 2040,2060,2080,2100,610,330
- 3000 PRINT "This program calculates the future value of"
- 3010 PRINT "a present sum held for a specified period,"
- 3020 PRINT "and interest compounded at the given rate."
- 3030 PRINT
- 3040 PRINT IN1$;:INPUT "",PV
- 3050 IF C=1 GOTO 3140
- 3060 PRINT IN3$;:INPUT "",AIR
- 3070 IF C=2 GOTO 3130
- 3080 PRINT IN4$;:INPUT "",NPPY
- 3090 IF C=3 GOTO 3120
- 3100 PRINT PR3$
- 3110 PRINT IN6$;:INPUT "",YY,MM,DD
- 3120 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 3130 IR=AIR/(100*NPPY)
- 3140 FV=PV*(1+IR)^NP
- 3150 CLS
- 3160 PRINT PR9$;:PRINT USING PAT1$;PV
- 3170 PRINT PR11$;:PRINT USING PAT3$;AIR
- 3180 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 3190 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 3200 PRINT
- 3210 COLOR 15,0
- 3220 PRINT PR10$;:PRINT USING PAT1$;FV
- 3230 COLOR 7,0
- 3240 PRINT
- 3250 PRINT PR1$
- 3260 PRINT
- 3270 PRINT "1 - Change present value"
- 3280 PRINT "2 - Change annual interest rate"
- 3290 PRINT "3 - Change number of periods per year"
- 3300 PRINT "4 - Change time period"
- 3310 PRINT "5 - Rerun using all new values"
- 3320 PRINT "6 - Return to main menu"
- 3330 PRINT
- 3340 PRINT PR2$
- 3350 C=VAL(INKEY$)
- 3360 IF C<1 OR C>6 GOTO 3350
- 3370 ON C GOTO 3040,3060,3080,3100,610,330
- 4000 PRINT "This program produces an amortization schedule"
- 4010 PRINT "given the initial loan amount, the interest rate"
- 4020 PRINT "and the time period of the loan. The schedule"
- 4030 PRINT "will begin at payment number 1 but this can be"
- 4040 PRINT "modified during execution."
- 4050 PRINT
- 4060 PRINT IN7$;:INPUT "",PV
- 4070 IF C=1 GOTO 4160
- 4080 PRINT IN3$;:INPUT "",AIR
- 4090 IF C=2 GOTO 4150
- 4100 PRINT IN4$;:INPUT "",NPPY
- 4110 IF C=3 GOTO 4140
- 4120 PRINT PR3$
- 4130 PRINT IN6$;:INPUT "",YY,MM,DD
- 4140 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 4150 IR=AIR/(100*NPPY)
- 4160 PMT=PV*(IR/(1-(1+IR)^(-NP)))
- 4170 B=1
- 4180 CLS
- 4190 TINT=0
- 4200 PRINT PR13$;:PRINT USING PAT1$;PV
- 4210 PRINT PR11$;:PRINT USING PAT3$;AIR;:PRINT " %"
- 4220 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 4230 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 4240 COLOR 15,0
- 4250 PRINT PR16$;:PRINT USING PAT1$;PMT
- 4260 PRINT
- 4270 PRINT "Payment Remaining Principal Principal Interest Interest"
- 4280 PRINT "Number Principal Payment Loan to date Payment Page to date"
- 4290 E=B+11
- 4300 IF E>NP THEN E=NP
- 4310 FOR I=B TO E
- 4320 K=I
- 4330 GOSUB 4610
- 4340 BALI=BAL
- 4350 K=K-1
- 4360 GOSUB 4610
- 4370 BALI1=BAL
- 4380 INTR=BALI-BALI1+PMT
- 4390 PRIN=PMT-INTR
- 4400 TPRIN=PV-BALI
- 4410 TINT=TINT+INTR
- 4420 PRINT USING PAT2$;I;:PRINT USING PAT1$;BALI,PRIN,TPRIN,INTR,TINT
- 4430 NEXT I
- 4440 PRINT
- 4450 COLOR 7,0
- 4460 PRINT "Press ENTER to continue with next 12 periods. Enter a beginning"
- 4470 INPUT "payment number if desired or enter 0 to quit. ",A$
- 4480 IF A$<>"" GOTO 4550
- 4490 IF E<>NP GOTO 4530
- 4500 LOCATE CSRLIN-2,1
- 4510 PRINT "Payment number";:PRINT USING PAT2$;NP;:PRINT " was the last payment. Enter a beginning"
- 4520 GOTO 4470
- 4530 B=B+12
- 4540 GOTO 4180
- 4550 IF A$=" " OR A$="0" GOTO 4630
- 4560 B=VAL(A$)
- 4570 IF B>=1 AND B<=NP GOTO 4180
- 4580 PRINT "Input was not 0 to quit, blank to continue or between 1 and";NP
- 4590 LOCATE CSRLIN-3,1
- 4600 GOTO 4460
- 4610 BAL=(1/(1+IR)^(-K))*((PMT*((1+IR)^(-K)-1))/IR+PV)
- 4620 RETURN
- 4630 CLS
- 4640 PRINT PR13$;:PRINT USING PAT1$;PV
- 4650 PRINT PR11$;:PRINT USING PAT3$;AIR;:PRINT " %"
- 4660 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 4670 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 4680 COLOR 15,0
- 4690 PRINT PR16$;:PRINT USING PAT1$;PMT
- 4700 COLOR 7,0
- 4710 PRINT
- 4720 PRINT PR1$
- 4730 PRINT
- 4740 PRINT "1 - Change initial loan amount"
- 4750 PRINT "2 - Change annual interest rate"
- 4760 PRINT "3 - Change number of payments per year"
- 4770 PRINT "4 - Change time period"
- 4780 PRINT "5 - Specify periodic payment"
- 4790 PRINT "6 - Rerun using all new values"
- 4800 PRINT "7 - Return to main menu"
- 4810 PRINT
- 4820 PRINT PR2$
- 4830 C=VAL(INKEY$)
- 4840 IF C<1 OR C>7 GOTO 4830
- 4850 ON C GOTO 4060,4080,4100,4120,4860,610,330
- 4860 PRINT IN5$;:INPUT "",PMT
- 4870 GOTO 4170
- 5000 PRINT "This routine calculates the compound interest rate"
- 5010 PRINT "on dollars held in deposit for a specified period."
- 5020 PRINT
- 5030 PRINT IN1$;:INPUT "",PV
- 5040 IF C=1 GOTO 5110
- 5050 PRINT IN2$;:INPUT "",FV
- 5060 IF C=2 GOTO 5110
- 5070 PRINT IN4$;:INPUT "",NPPY
- 5080 IF C=3 GOTO 5110
- 5090 PRINT PR3$
- 5100 PRINT IN6$;:INPUT "",YY,MM,DD
- 5110 NP=CINT(NPPY*(YY+MM/12+YY/365.25))
- 5120 IR=((FV/PV)^(1/NP)-1)*100*NPPY
- 5130 CLS
- 5140 PRINT PR9$;:PRINT USING PAT1$;PV
- 5150 PRINT PR10$;:PRINT USING PAT1$;FV
- 5160 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 5170 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 5180 PRINT
- 5190 COLOR 15,0
- 5200 PRINT PR11$;:PRINT USING PAT3$;IR;:PRINT " %"
- 5210 COLOR 7,0
- 5220 PRINT
- 5230 PRINT PR1$
- 5240 PRINT
- 5250 PRINT "1 - Change present value"
- 5260 PRINT "2 - Change future value"
- 5270 PRINT "3 - Change number of periods per year"
- 5280 PRINT "4 - Change time period"
- 5290 PRINT "5 - Rerun using all new values"
- 5300 PRINT "6 - Return to main menu"
- 5310 PRINT
- 5320 PRINT PR2$
- 5330 C=VAL(INKEY$)
- 5340 IF C<1 OR C>6 GOTO 5330
- 5350 ON C GOTO 5030,5050,5070,5090,610,330
- 6000 PRINT "This routine determines the annual interest rate of"
- 6010 PRINT "an installment loan given the initial loan amount,"
- 6020 PRINT "the periodic payment, and the time period of the loan."
- 6030 PRINT
- 6040 PRINT IN7$;:INPUT "",PV
- 6050 IF C=1 GOTO 6130
- 6060 PRINT IN5$;:INPUT "",PMT
- 6070 IF C=2 GOTO 6130
- 6080 PRINT IN4$;:INPUT "",NPPY
- 6090 IF C=3 GOTO 6130
- 6100 PRINT PR3$
- 6110 PRINT IN6$;:INPUT "",YY,MM,DD
- 6120 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 6130 IR=(PMT/PV)-(PV/(PMT*NP^2))
- 6140 FI=(1-(1+IR)^(-NP))-IR*PV/PMT
- 6150 DFI=((((NP/(1+1/IR))+1)*(1+IR)^(-NP))-1)/IR
- 6160 IR=IR-FI/DFI
- 6170 LOCATE 25,1
- 6180 PRINT USING PAT4$;ABS(FI/DFI);
- 6190 IF ABS(FI/DFI)>9.99E-07 GOTO 6140
- 6200 IR=IR*NPPY*100
- 6210 CLS
- 6220 PRINT PR13$;:PRINT USING PAT1$;PV
- 6230 PRINT PR16$;:PRINT USING PAT1$;PMT
- 6240 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 6250 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 6260 PRINT
- 6270 COLOR 15,0
- 6280 PRINT PR11$;:PRINT USING PAT3$;IR;:PRINT " %"
- 6290 COLOR 7,0
- 6300 PRINT
- 6310 PRINT PR1$
- 6320 PRINT
- 6330 PRINT "1 - Change initial loan amount"
- 6340 PRINT "2 - Change periodic payment"
- 6350 PRINT "3 - Change number of periods per year"
- 6360 PRINT "4 - Change time period"
- 6370 PRINT "5 - Rerun using all new values"
- 6380 PRINT "6 - Return to main menu"
- 6390 PRINT
- 6400 PRINT PR2$
- 6410 C=VAL(INKEY$)
- 6420 IF C<1 OR C>6 GOTO 6410
- 6430 ON C GOTO 6040,6060,6080,6100,610,330
- 7000 RESTORE 7003
- 7003 DATA 0,31,59,90,120,151,181,212,243,273,304,334,365
- 7006 FOR I=0 TO 12
- 7009 READ MD(I)
- 7012 NEXT I
- 7015 DATA Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday
- 7018 FOR I=0 TO 6
- 7021 READ DOW$(I)
- 7024 NEXT I
- 7027 DATA January,February,March,April,May,June,July,August,September,October,November,December
- 7030 FOR I=1 TO 12
- 7033 READ MOY$(I)
- 7036 NEXT I
- 7039 CLS
- 7042 PRINT "This routine will compute the number of days between two"
- 7045 PRINT "dates, add or subtract an amount of time to a given date"
- 7048 PRINT "and determine the new date, determine the day of the week"
- 7051 PRINT "for a given date and produce a calender for a given month."
- 7054 PRINT
- 7057 PRINT "Which routine would you like to execute?"
- 7060 PRINT
- 7063 PRINT "1 - Determine the number of days between two dates"
- 7066 PRINT "2 - Determine new date for a date plus or minus a given time"
- 7069 PRINT "3 - Determine the day of week for a given date"
- 7072 PRINT "4 - Produce a calender for a given month"
- 7075 PRINT
- 7078 PRINT PR2$
- 7081 C=VAL(INKEY$)
- 7084 IF C<1 OR C>4 GOTO 7081
- 7087 ON C GOTO 7090,7294,7570,7675
- 7090 CLS
- 7093 C=0
- 7096 PRINT "Number of days between two dates."
- 7099 PRINT
- 7102 PRINT "Using the form MM-DD-YYYY"
- 7105 PRINT
- 7108 INPUT "Enter the first date ",DATE1$
- 7111 IF DATE1$="" THEN DATE1$=DATE$
- 7114 IF DATE1$=DATE$ AND C<>1 THEN LOCATE 5,23:PRINT DATE1$
- 7117 YY=VAL(RIGHT$(DATE1$,4))
- 7120 MM=VAL(LEFT$(DATE1$,2))
- 7123 DD=VAL(MID$(DATE1$,4,2))
- 7126 IF MM>=1 AND MM<=12 GOTO 7144
- 7129 PRINT "Month must be 1 thru 12"
- 7132 LOCATE CSRLIN-2,1
- 7135 PRINT SPACE$(40)
- 7138 LOCATE CSRLIN-1,1
- 7141 GOTO 7108
- 7144 IF DD>=1 AND DD<=FND(MM) GOTO 7153
- 7147 PRINT "Day must be 1 thru";FND(MM)
- 7150 GOTO 7132
- 7153 Y1=YY
- 7156 M1=MM
- 7159 D1=DD
- 7162 GOSUB 7849
- 7165 A1=X
- 7168 A2=DW
- 7171 IF C=1 GOTO 7234
- 7174 INPUT "Enter the second date ",DATE2$
- 7177 IF DATE2$="" THEN DATE2$=DATE$
- 7180 YY=VAL(RIGHT$(DATE2$,4))
- 7183 MM=VAL(LEFT$(DATE2$,2))
- 7186 DD=VAL(MID$(DATE2$,4,2))
- 7189 IF MM>=1 AND MM<=12 GOTO 7207
- 7192 PRINT "Month must be 1 thru 12"
- 7195 LOCATE CSRLIN-2,1
- 7198 PRINT SPACE$(40)
- 7201 LOCATE CSRLIN-1,1
- 7204 GOTO 7174
- 7207 IF DD>=1 AND DD<=FND(MM) GOTO 7216
- 7210 PRINT "Day must be 1 thru";FND(MM)
- 7213 GOTO 7195
- 7216 Y2=YY
- 7219 M2=MM
- 7222 D2=DD
- 7225 GOSUB 7849
- 7228 B1=X
- 7231 B2=DW
- 7234 CLS
- 7237 PRINT "First date ";DATE1$;" a ";DOW$(A2)
- 7240 PRINT "Second date ";DATE2$;" a ";DOW$(B2)
- 7243 PRINT
- 7246 COLOR 15,0
- 7249 PRINT "The difference is ";:PRINT USING PAT5$;ABS(B1-A1);:PRINT " days."
- 7252 COLOR 7,0
- 7255 PRINT
- 7258 PRINT PR1$
- 7261 PRINT
- 7264 PRINT "1 - Change first date"
- 7267 PRINT "2 - Change second date"
- 7270 PRINT "3 - Return to the beginning of this routine"
- 7273 PRINT "4 - Return to the beginning of the date routines"
- 7276 PRINT "5 - Return to main menu"
- 7279 PRINT
- 7282 PRINT PR2$
- 7285 C=VAL(INKEY$)
- 7288 IF C<1 OR C>5 GOTO 7285
- 7291 ON C GOTO 7108,7174,7090,7039,330
- 7294 CLS
- 7297 C=0
- 7300 PRINT "Given date plus or minus a time period equals a new date."
- 7303 PRINT
- 7306 PRINT "Using the form MM-DD-YYYY"
- 7309 PRINT
- 7312 INPUT "Enter the date ",DATE1$
- 7315 IF DATE1$="" THEN DATE1$=DATE$
- 7318 YY=VAL(RIGHT$(DATE1$,4))
- 7321 MM=VAL(LEFT$(DATE1$,2))
- 7324 DD=VAL(MID$(DATE1$,4,2))
- 7327 IF MM>=1 AND MM<=12 GOTO 7339
- 7330 PRINT "Month must be 1 thru 12"
- 7333 LOCATE CSRLIN-2,1
- 7336 GOTO 7312
- 7339 IF DD>=1 AND DD<=FND(MM) GOTO 7348
- 7342 PRINT "Day must be 1 thru";FND(MM)
- 7345 GOTO 7333
- 7348 Y1=YY
- 7351 M1=MM
- 7354 D1=DD
- 7357 GOSUB 7849
- 7360 A1=X
- 7363 A2=DW
- 7366 IF C=1 GOTO 7483
- 7369 PRINT PR3$
- 7372 PRINT IN6$;:INPUT "",YY,MM,DD
- 7375 Y3=YY
- 7378 M3=MM
- 7381 D3=DD
- 7384 IF C=2 GOTO 7396
- 7387 PRINT "Plus (+) or minus (-)"
- 7390 A$=INKEY$
- 7393 IF A$<>"+" AND A$<>"-" GOTO 7390
- 7396 IF A$="+" THEN Y2=Y1+Y3 ELSE Y2=Y1-Y3
- 7399 IF A$="+" THEN M2=M1+M3 ELSE M2=M1-M3
- 7402 IF A$="+" THEN D2=D1+D3 ELSE D2=D1-D3
- 7405 IF M2>=1 AND M2<=12 GOTO 7429
- 7408 IF M2>12 GOTO 7420
- 7411 M2=M2+12
- 7414 Y2=Y2-1
- 7417 GOTO 7405
- 7420 M2=M2-12
- 7423 Y2=Y2+1
- 7426 GOTO 7405
- 7429 IF D2>=1 AND D2<=FND(M2) GOTO 7465
- 7432 IF D2>FND(M2) GOTO 7447
- 7435 M2=M2-1
- 7438 IF M2=0 THEN M2=12:Y2=Y2-1
- 7441 D2=D2+FND(M2)
- 7444 GOTO 7429
- 7447 M2=M2+1
- 7450 IF M2=13 THEN M2=1:Y2=Y2+1
- 7453 M=M2-1
- 7456 IF M=0 THEN M=12
- 7459 D2=D2-FND(M)
- 7462 GOTO 7429
- 7465 YY=Y2
- 7468 MM=M2
- 7471 DD=D2
- 7474 GOSUB 7849
- 7477 B1=X
- 7480 B2=DW
- 7483 CLS
- 7486 PRINT "Date of ";DATE1$;" a ";DOW$(A2)
- 7489 IF A$="+" THEN PRINT "Plus"; ELSE PRINT "Minus";
- 7492 PRINT Y3;"years";M3;"months and";D3;"days."
- 7495 PRINT
- 7498 COLOR 15,0
- 7501 PRINT "New date is ";
- 7504 PRINT USING PAT6$;M2;
- 7507 PRINT "-";
- 7510 PRINT USING PAT6$;D2;
- 7513 PRINT "-";
- 7516 PRINT USING PAT2$;Y2;
- 7519 PRINT " a ";DOW$(B2)
- 7522 PRINT "Difference of";ABS(B1-A1);"days."
- 7525 COLOR 7,0
- 7528 PRINT
- 7531 PRINT PR1$
- 7534 PRINT
- 7537 PRINT "1 - Change date"
- 7540 PRINT "2 - Change time period"
- 7543 PRINT "3 - Change plus or minus"
- 7546 PRINT "4 - Rerun using all new values"
- 7549 PRINT "5 - Return to beginning of date routine"
- 7552 PRINT "6 - Return to main menu"
- 7555 PRINT
- 7558 PRINT PR2$
- 7561 C=VAL(INKEY$)
- 7564 IF C<1 OR C>6 GOTO 7561
- 7567 ON C GOTO 7306,7369,7387,7294,7039,330
- 7570 CLS
- 7573 C=0
- 7576 PRINT "This routine will determine the day of the week"
- 7579 PRINT "for a given date."
- 7582 PRINT
- 7585 PRINT "Using the form MM-DD-YYYY"
- 7588 PRINT
- 7591 INPUT "Enter the date ",DATE1$
- 7594 IF DATE1$="" THEN DATE1$=DATE$
- 7597 YY=VAL(RIGHT$(DATE1$,4))
- 7600 MM=VAL(LEFT$(DATE1$,2))
- 7603 DD=VAL(MID$(DATE1$,4,2))
- 7606 IF MM>=1 AND MM<=12 GOTO 7618
- 7609 PRINT "Month must be 1 thru 12"
- 7612 LOCATE CSRLIN-2,1
- 7615 GOTO 7591
- 7618 IF DD>=1 AND DD<=FND(MM) GOTO 7627
- 7621 PRINT "Day must be 1 thru";FND(MM)
- 7624 GOTO 7612
- 7627 GOSUB 7849
- 7630 CLS
- 7633 COLOR 15,0
- 7636 PRINT DATE1$;" a ";DOW$(DW)
- 7639 COLOR 7,0
- 7642 PRINT
- 7645 PRINT PR1$
- 7648 PRINT
- 7651 PRINT "1 - Change date"
- 7654 PRINT "2 - Return to the beginning of the date routine"
- 7657 PRINT "3 - Return to main menu"
- 7660 PRINT
- 7663 PRINT PR2$
- 7666 C=VAL(INKEY$)
- 7669 IF C<1 OR C>3 GOTO 7666
- 7672 ON C GOTO 7591,7039,330
- 7675 CLS
- 7678 C=0
- 7681 PRINT "This routine will produce a one month calendar for"
- 7684 PRINT "a given year and month. Since you may want to copy"
- 7687 PRINT "the calendar to the printer using <Shift-PrtSc>, the"
- 7690 PRINT "calendar is displayed and the system will wait for"
- 7693 PRINT "any key to be pressed before asking for a new year"
- 7696 PRINT "and month. This message will not be displayed on the"
- 7699 PRINT "screen with the calendar."
- 7702 PRINT
- 7705 PRINT "Using the form MM-YYYY"
- 7708 INPUT "Enter the month and year ",DATE1$
- 7711 MM=VAL(LEFT$(DATE1$,2))
- 7714 YY=VAL(RIGHT$(DATE1$,4))
- 7717 IF MM>=1 AND MM<=12 GOTO 7729
- 7720 PRINT "The month must be between 1 thru 12."
- 7723 LOCATE CSRLIN-2,1
- 7726 GOTO 7708
- 7729 DD=1
- 7732 GOSUB 7849
- 7735 E=FND(MM)
- 7738 IF MM=2 THEN E=E+LY
- 7741 CLS
- 7744 ROW=5
- 7747 COL=5+10*DW
- 7750 T=(72-(LEN(MOY$(MM))))/2
- 7753 PRINT TAB(T);MOY$(MM);YY
- 7756 PRINT
- 7759 PRINT TAB(6);DOW$(0);TAB(16);DOW$(1);TAB(26);DOW$(2);TAB(35);DOW$(3);TAB(45);DOW$(4);TAB(56);DOW$(5);TAB(65);DOW$(6)
- 7762 PRINT
- 7765 LOCATE 4,1
- 7768 PRINT TAB(4);CHR$(218);STRING$(9,196);CHR$(194);STRING$(9,196);CHR$(194);STRING$(9,196);CHR$(194);STRING$(9,196);CHR$(194);STRING$(9,196);CHR$(194);STRING$(9,196);CHR$(194);STRING$(9,196);CHR$(191)
- 7771 FOR I=1 TO 5
- 7774 PRINT TAB(4);CHR$(179);TAB(14);CHR$(179);TAB(24);CHR$(179);TAB(34);CHR$(179);TAB(44);CHR$(179);TAB(54);CHR$(179);TAB(64);CHR$(179);TAB(74);CHR$(179)
- 7777 PRINT TAB(4);CHR$(179);TAB(14);CHR$(179);TAB(24);CHR$(179);TAB(34);CHR$(179);TAB(44);CHR$(179);TAB(54);CHR$(179);TAB(64);CHR$(179);TAB(74);CHR$(179)
- 7780 PRINT TAB(4);CHR$(195);STRING$(9,196);CHR$(197);STRING$(9,196);CHR$(197);STRING$(9,196);CHR$(197);STRING$(9,196);CHR$(197);STRING$(9,196);CHR$(197);STRING$(9,196);CHR$(197);STRING$(9,196);CHR$(180)
- 7783 NEXT I
- 7786 PRINT TAB(4);CHR$(179);TAB(14);CHR$(179);TAB(24);CHR$(179);TAB(34);CHR$(179);TAB(44);CHR$(179);TAB(54);CHR$(179);TAB(64);CHR$(179);TAB(74);CHR$(179)
- 7789 PRINT TAB(4);CHR$(179);TAB(14);CHR$(179);TAB(24);CHR$(179);TAB(34);CHR$(179);TAB(44);CHR$(179);TAB(54);CHR$(179);TAB(64);CHR$(179);TAB(74);CHR$(179)
- 7792 PRINT TAB(4);CHR$(192);STRING$(9,196);CHR$(193);STRING$(9,196);CHR$(193);STRING$(9,196);CHR$(193);STRING$(9,196);CHR$(193);STRING$(9,196);CHR$(193);STRING$(9,196);CHR$(193);STRING$(9,196);CHR$(217)
- 7795 FOR I=1 TO E
- 7798 LOCATE ROW,COL
- 7801 PRINT USING "##";I
- 7804 IF COL>=65 THEN COL=-5:ROW=ROW+3
- 7807 COL=COL+10
- 7810 NEXT I
- 7813 IF LEN(INKEY$)<1 GOTO 7813
- 7816 CLS
- 7819 PRINT PR1$
- 7822 PRINT
- 7825 PRINT "1 - Change date"
- 7828 PRINT "2 - Return to beginning of date routine"
- 7831 PRINT "3 - Return to main menu"
- 7834 PRINT
- 7837 PRINT PR2$
- 7840 C=VAL(INKEY$)
- 7843 IF C<1 OR C>3 GOTO 7840
- 7846 ON C GOTO 7705,7039,330
- 7849 Y=YY-1
- 7852 LY=0
- 7855 X=365*Y+FIX(Y/4)-FIX(Y/100)+FIX(Y/400)+MD(MM-1)+DD
- 7858 IF YY<>4*FIX(YY/4) GOTO 7873
- 7861 LY=1
- 7864 IF YY=400*FIX(YY/400) GOTO 7870
- 7867 IF YY=100*FIX(YY/100) THEN LY=0:GOTO 7873
- 7870 IF MM>=3 THEN X=X+1
- 7873 DW=CINT(((X/7)-FIX(X/7))*7)
- 7876 RETURN
- 8000 PRINT "This routine determines the time period for an installment"
- 8010 PRINT "loan given the initial loan amount, the annual interest rate,"
- 8020 PRINT "the periodic payment and the number of payments per year."
- 8030 PRINT
- 8040 PRINT IN7$;:INPUT "",PV
- 8050 IF C=1 GOTO 8120
- 8060 PRINT IN3$;:INPUT "",AIR
- 8070 IF C=2 GOTO 8110
- 8080 PRINT IN5$;:INPUT "",PMT
- 8090 IF C=3 GOTO 8120
- 8100 PRINT IN4$;:INPUT "",NPPY
- 8110 IR=AIR/(NPPY*100)
- 8120 IF IR*PV/PMT>1 GOTO 8370
- 8130 NP=-LOG(1-((IR*PV)/PMT))/LOG(1+IR)
- 8140 CLS
- 8150 PRINT PR13$;:PRINT USING PAT1$;PV
- 8160 PRINT PR11$;:PRINT USING PAT3$;AIR;:PRINT " %"
- 8170 PRINT PR16$;:PRINT USING PAT1$;PMT
- 8180 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 8190 PRINT
- 8200 COLOR 15,0
- 8210 PRINT PR4$;:PRINT USING PAT3$;NP/NPPY;:PRINT " years or ";:PRINT USING PAT3$;NP;:PRINT " periods."
- 8220 COLOR 7,0
- 8230 PRINT
- 8240 PRINT PR1$
- 8250 PRINT
- 8260 PRINT "1 - Change initial loan amount"
- 8270 PRINT "2 - Change annual interest rate"
- 8280 PRINT "3 - Change periodic payment"
- 8290 PRINT "4 - Change number of periods per year"
- 8300 PRINT "5 - Rerun using all new values"
- 8310 PRINT "6 - Return to main menu"
- 8320 PRINT
- 8330 PRINT PR2$
- 8340 C=VAL(INKEY$)
- 8350 IF C<1 OR C>6 GOTO 8340
- 8360 ON C GOTO 8040,8060,8080,8100,610,330
- 8370 PRINT
- 8380 PRINT "Values for initial loan amount, payment and interest rate"
- 8390 PRINT "are not reasonable. Payment must be greater than the initial
- 8400 PRINT "loan amount time the periodic interest rate."
- 8410 PRINT
- 8420 PRINT "Hit any key to return to the beginning of this routine."
- 8430 IF LEN(INKEY$)<1 GOTO 8430
- 8440 GOTO 610
- 9000 PRINT "This routine determines the present value of a series of"
- 9010 PRINT "payments, given the periodic payment, the annual interest"
- 9020 PRINT "rate, the number of payments per year and the number of"
- 9030 PRINT "payments remaining. This is normally used to determine the"
- 9040 PRINT "amount remaining on a loan."
- 9050 PRINT
- 9060 PRINT IN5$;:INPUT "",PMT
- 9070 IF C=1 GOTO 9150
- 9080 PRINT IN3$;:INPUT "",AIR
- 9090 IF C=2 GOTO 9150
- 9100 PRINT IN4$;:INPUT "",NPPY
- 9110 IF C=3 GOTO 9140
- 9120 PRINT PR3$
- 9130 PRINT IN6$;:INPUT "",YY,MM,DD
- 9140 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 9150 IR=AIR/(NPPY*100)
- 9160 PV=PMT*((1-(1+IR)^(-NP))/IR)
- 9170 CLS
- 9180 PRINT PR16$;:PRINT USING PAT1$;PMT
- 9190 PRINT PR11$;:PRINT USING PAT3$;AIR;:PRINT " %"
- 9200 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 9210 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 9220 PRINT
- 9230 COLOR 15,0
- 9240 PRINT PR9$;:PRINT USING PAT1$;PV
- 9250 COLOR 7,0
- 9260 PRINT
- 9270 PRINT PR1$
- 9280 PRINT
- 9290 PRINT "1 - Change periodic payment"
- 9300 PRINT "2 - Change annual interest rate"
- 9310 PRINT "3 - Change number of payments per year"
- 9320 PRINT "4 - Change time period"
- 9330 PRINT "5 - Rerun using all new values"
- 9340 PRINT "6 - Return to main menu"
- 9350 PRINT
- 9360 PRINT PR2$
- 9370 C=VAL(INKEY$)
- 9380 IF C<1 OR C>6 GOTO 9370
- 9390 ON C GOTO 9060,9080,9100,9120,610,330
- 11000 PRINT "This routine figures the nominal and effective"
- 11010 PRINT "interest rates when given the present value, future"
- 11020 PRINT "value, number of periods per year and the time period."
- 11030 PRINT
- 11040 PRINT IN1$;:INPUT "",PV
- 11050 IF C=1 GOTO 11130
- 11060 PRINT IN2$;:INPUT "",FV
- 11070 IF C=2 GOTO 11130
- 11080 PRINT IN4$;:INPUT "",NPPY
- 11090 IF C=3 GOTO 11120
- 11100 PRINT PR3$
- 11110 PRINT IN6$;:INPUT "",YY,MM,DD
- 11120 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 11130 ER=((FV/PV)^(NPPY/NP)-1)*100
- 11140 NR=(NPPY*((FV/PV)^(1/NP))-NPPY)*100
- 11150 CLS
- 11160 PRINT PR9$;:PRINT USING PAT1$;PV
- 11170 PRINT PR10$;:PRINT USING PAT1$;FV
- 11180 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 11190 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 11200 PRINT
- 11210 COLOR 15,0
- 11220 PRINT "Nominal annual interest rate is ";:PRINT USING PAT3$;NR;:PRINT " %"
- 11230 PRINT
- 11240 PRINT "Effective annual interest rate is ";:PRINT USING PAT3$;ER;:PRINT " %"
- 11250 COLOR 7,0
- 11260 PRINT
- 11270 PRINT PR1$
- 11280 PRINT
- 11290 PRINT "1 - Change present value"
- 11300 PRINT "2 - Change future value"
- 11310 PRINT "3 - Change number of periods per year"
- 11320 PRINT "4 - Change time period"
- 11330 PRINT "5 - Rerun using all new values"
- 11340 PRINT "6 - Return to main menu"
- 11350 PRINT
- 11360 PRINT PR2$
- 11370 C=VAL(INKEY$)
- 11380 IF C<1 OR C>6 GOTO 11370
- 11390 ON C GOTO 11040,11060,11080,11100,610,330
- 12000 PRINT "This program figures the internal rate of return on an"
- 12010 PRINT "investment given the purchase price, expected future"
- 12020 PRINT "value, the time period and the earnings for each period."
- 12030 PRINT
- 12040 PRINT IN1$;:INPUT "",PV
- 12050 IF C=1 GOTO 12260
- 12060 PRINT IN2$;:INPUT "",FV
- 12070 IF C=2 GOTO 12260
- 12080 PRINT IN4$;:INPUT "",NPPY
- 12090 IF C=3 GOTO 12120
- 12100 PRINT PR3$
- 12110 PRINT IN6$;:INPUT "",YY,MM,DD
- 12120 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 12130 GOSUB 12580
- 12140 PRINT "Enter the earnings for each period."
- 12150 PRINT
- 12160 PRINT " Period Period"
- 12170 PRINT " Number Earnings"
- 12180 FOR I=1 TO NP
- 12190 PRINT SPACE$(6);
- 12200 PRINT USING PAT2$;I;
- 12210 PRINT SPACE$(20);
- 12220 LOCATE CSRLIN,POS(1)-12
- 12230 INPUT "",PE(I)
- 12240 LOCATE CSRLIN-1,1
- 12250 NEXT I
- 12260 IR=0.15/NPPY
- 12270 I1=0.25
- 12280 PVFV=FV/(1+IR)^NP
- 12290 TPVE=0
- 12300 FOR I=1 TO NP
- 12310 PVPE=PE(I)/(1+IR)^I
- 12320 TPVE=TPVE+PVPE
- 12330 NEXT I
- 12340 I1=IR*(PVFV+TPVE)/PV
- 12350 LOCATE 25,1
- 12360 PRINT USING PAT4$;ABS(IR-I1);
- 12370 IF ABS(IR-I1)>9.99E-07 THEN IR=I1:GOTO 12280
- 12380 AIR=IR*NPPY*100
- 12390 GOSUB 12580
- 12400 COLOR 15,0
- 12410 PRINT "Internal rate of return is ";:PRINT USING PAT3$;AIR;:PRINT " %"
- 12420 COLOR 7,0
- 12430 PRINT
- 12440 PRINT PR1$
- 12450 PRINT
- 12460 PRINT "1 - Change present value"
- 12470 PRINT "2 - Change future value"
- 12480 PRINT "3 - Change number of periods per year"
- 12490 PRINT "4 - Change time period"
- 12500 PRINT "5 - Change periodic earnings"
- 12510 PRINT "6 - Rerun using all new values"
- 12520 PRINT "7 - Return to main menu"
- 12530 PRINT
- 12540 PRINT PR2$
- 12550 C=VAL(INKEY$)
- 12560 IF C<1 OR C>7 GOTO 12550
- 12570 ON C GOTO 12040,12060,12080,12100,12140,610,330
- 12580 CLS
- 12590 PRINT PR9$;:PRINT USING PAT1$;PV
- 12600 PRINT PR10$;:PRINT USING PAT1$;FV
- 12610 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 12620 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 12630 PRINT
- 12640 RETURN
- 13000 PRINT "This routine calculates the future value of"
- 13010 PRINT "regular deposits, given the periodic deposit,"
- 13020 PRINT "the annual interest rate and time period. An"
- 13030 PRINT "assumption is that the interest is compounded"
- 13040 PRINT "coincident with the deposits."
- 13050 PRINT
- 13060 PRINT IN5$;:INPUT "",PMT
- 13070 IF C=1 GOTO 13160
- 13080 PRINT IN3$;:INPUT "",AIR
- 13090 IF C=2 GOTO 13150
- 13100 PRINT IN4$;:INPUT "",NPPY
- 13110 IF C=3 GOTO 13140
- 13120 PRINT PR3$
- 13130 PRINT IN6$;:INPUT "",YY,MM,DD
- 13140 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 13150 IR=AIR/(NPPY*100)
- 13160 FV=(PMT/IR)*(((1+IR)^(NP+1))-(1+IR))
- 13170 CLS
- 13180 PRINT PR16$;:PRINT USING PAT1$;PMT
- 13190 PRINT PR11$;:PRINT USING PAT3$;AIR;:PRINT " %"
- 13200 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 13210 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 13220 PRINT
- 13230 COLOR 15,0
- 13240 PRINT PR10$;:PRINT USING PAT1$;FV
- 13250 COLOR 7,0
- 13260 PRINT
- 13270 PRINT PR1$
- 13280 PRINT
- 13290 PRINT "1 - Change periodic payment"
- 13300 PRINT "2 - Change annual interest rate"
- 13310 PRINT "3 - Change number of periods per year"
- 13320 PRINT "4 - Change time period"
- 13330 PRINT "5 - Rerun using all new values"
- 13340 PRINT "6 - Return to main menu"
- 13350 PRINT
- 13360 PRINT PR2$
- 13370 C=VAL(INKEY$)
- 13380 IF C<1 OR C>6 GOTO 13370
- 13390 ON C GOTO 13060,13080,13100,13120,610,330
- 14000 PRINT "This routine calculates the regular deposits needed"
- 14010 PRINT "to produce a specified future value, given the annual"
- 14020 PRINT "interest rate and time period. An assumption is that"
- 14030 PRINT "the interest is compounded coincident with the deposits."
- 14040 PRINT
- 14050 PRINT IN2$;:INPUT "",FV
- 14060 IF C=1 GOTO 14150
- 14070 PRINT IN3$;:INPUT "",AIR
- 14080 IF C=2 GOTO 14140
- 14090 PRINT IN4$;:INPUT "",NPPY
- 14100 IF C=3 GOTO 14130
- 14110 PRINT PR3$
- 14120 PRINT IN6$;:INPUT "",YY,MM,DD
- 14130 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 14140 IR=AIR/(NPPY*100)
- 14150 PMT=(FV*IR)/(((1+IR)^(NP+1))-(1+IR))
- 14160 CLS
- 14170 PRINT PR10$;:PRINT USING PAT1$;FV
- 14180 PRINT PR11$;:PRINT USING PAT3$;AIR;:PRINT " %"
- 14190 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 14200 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 14210 PRINT
- 14220 COLOR 15,0
- 14230 PRINT PR16$;:PRINT USING PAT1$;PMT
- 14240 COLOR 7,0
- 14250 PRINT
- 14260 PRINT PR1$
- 14270 PRINT
- 14280 PRINT "1 - Change future value"
- 14290 PRINT "2 - Change annual interest rate"
- 14300 PRINT "3 - Change number of periods per year"
- 14310 PRINT "4 - Change time period"
- 14320 PRINT "5 - Rerun using all new values"
- 14330 PRINT "6 - Return to main menu"
- 14340 PRINT
- 14350 PRINT PR2$
- 14360 C=VAL(INKEY$)
- 14370 IF C<1 OR C>6 GOTO 14360
- 14380 ON C GOTO 14050,14070,14090,14110,610,330
- 15000 PRINT "This program determines the amount of depreciation for"
- 15010 PRINT "each period by applying a specified depreciation rate"
- 15020 PRINT "percentage to the given original value."
- 15030 PRINT
- 15040 INPUT "Original price, in dollars $ ",PV
- 15050 IF C=1 GOTO 15140
- 15060 INPUT "Annual depreciation rate, in % ",ADR
- 15070 IF C=2 GOTO 15130
- 15080 PRINT IN4$;:INPUT "",NPPY
- 15090 IF C=3 GOTO 15120
- 15100 PRINT PR3$
- 15110 PRINT IN6$;:INPUT "",YY,MM,DD
- 15120 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 15130 DR=ADR/(NPPY*100)
- 15140 TD=0
- 15150 B=1
- 15160 E=B+11
- 15170 IF E>NP THEN E=NP
- 15180 CLS
- 15190 PRINT "Original value ";:PRINT USING PAT1$;PV
- 15200 PRINT "Annual depreciation rate ";:PRINT USING PAT3$;ADR;:PRINT " %"
- 15210 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 15220 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 15230 PRINT
- 15240 PRINT "Period ";"Depreciation";" Remainder"
- 15250 COLOR 15,0
- 15260 FOR I=B TO E
- 15270 DP=DR*PV*(1-DR)^(I-1)
- 15280 TD=TD+DP
- 15290 PRINT USING PAT2$;I;:PRINT USING PAT1$;DP,PV-TD
- 15300 NEXT I
- 15310 COLOR 7,0
- 15320 PRINT
- 15330 PRINT "Press ENTER to continue with next 12 periods. Enter a beginning"
- 15340 INPUT "period number if desired or enter 0 to quit ",A$
- 15350 IF A$<>"" GOTO 15420
- 15360 IF E<>NP GOTO 15400
- 15370 LOCATE CSRLIN-2,1
- 15380 PRINT "Period";:PRINT USING PAT2$;YY;:PRINT " was the last period. Enter a beginning"
- 15390 GOTO 15340
- 15400 B=B+12
- 15410 GOTO 15160
- 15420 IF A$=" " OR A$="0" GOTO 15480
- 15430 B=VAL(A$)
- 15440 IF B>=1 AND B<=YY GOTO 15160
- 15450 PRINT "Input was not 0 to quit, blank to continue, or between 1 and";YY
- 15460 LOCATE CSRLIN-3,1
- 15470 GOTO 15330
- 15480 CLS
- 15490 PRINT "Original value ";:PRINT USING PAT1$;PV
- 15500 PRINT "Annual depreciation rate ";:PRINT USING PAT3$;ADR;:PRINT " %"
- 15510 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 15520 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 15530 PRINT
- 15540 PRINT PR1$
- 15550 PRINT
- 15560 PRINT "1 - Change original price"
- 15570 PRINT "2 - Change annual depreciation rate"
- 15580 PRINT "3 - Change number of periods per year"
- 15590 PRINT "4 - Change time period"
- 15600 PRINT "5 - Rerun this program using all new values"
- 15610 PRINT "6 - Return to main menu"
- 15620 PRINT
- 15630 PRINT PR2$
- 15640 C=VAL(INKEY$)
- 15650 IF C<1 OR C>6 GOTO 15640
- 15660 ON C GOTO 15040,15060,15080,15100,610,330
- 16000 PRINT "This program determines the depreciation rate if the"
- 16010 PRINT "present value, future value, and holding time are known."
- 16020 PRINT
- 16030 PRINT IN1$;:INPUT "",PV
- 16040 IF C=1 GOTO 16120
- 16050 PRINT IN2$;:INPUT "",FV
- 16060 IF C=2 GOTO 16120
- 16070 PRINT IN4$;:INPUT "",NPPY
- 16080 IF C=3 GOTO 16110
- 16090 PRINT PR3$
- 16100 PRINT IN6$;:INPUT "",YY,MM,DD
- 16110 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 16120 DR=(1-(FV/PV)^(1/NP))*100*NPPY
- 16130 CLS
- 16140 PRINT
- 16150 PRINT PR9$;:PRINT USING PAT1$;PV
- 16160 PRINT PR10$;:PRINT USING PAT1$;FV
- 16170 PRINT PR11$;:PRINT USING PAT2$;NPPY
- 16180 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 16190 PRINT
- 16200 COLOR 15,0
- 16210 PRINT "The depreciation rate is ";:PRINT USING PAT3$;DR;:PRINT " %"
- 16220 COLOR 7,0
- 16230 PRINT
- 16240 PRINT PR1$
- 16250 PRINT
- 16260 PRINT "1 - Change persent value"
- 16270 PRINT "2 - Change future value"
- 16280 PRINT "3 - Change number of periods per year"
- 16290 PRINT "4 - Change time period"
- 16300 PRINT "5 - Rerun using all new values"
- 16310 PRINT "6 - Return to main menu"
- 16320 PRINT
- 16330 PRINT PR2$
- 16340 C=VAL(INKEY$)
- 16350 IF C<1 OR C>6 GOTO 16340
- 16360 ON C GOTO 16030,16050,16070,16090,610,330
- 17000 PRINT "This program determines the salvage value of an item"
- 17010 PRINT "given the original price, annual depreciation rate"
- 17020 PRINT "and it's age."
- 17030 PRINT
- 17040 INPUT "Original price, in dollars $ ",OP
- 17050 IF C=1 GOTO 17140
- 17060 INPUT "Annual depreciation rate, in % ",ADR
- 17070 IF C=2 GOTO 17130
- 17080 PRINT IN4$;:INPUT "",NPPY
- 17090 IF C=3 GOTO 17120
- 17100 PRINT PR3$
- 17110 PRINT IN6$;:INPUT "",YY,MM,DD
- 17120 NP=CINT(NPPY*(YY+MM/12+DD365.25))
- 17130 DR=ADR/(NPPY*100)
- 17140 SV=OP*(1-DR)^NP
- 17150 CLS
- 17160 PRINT "Original price ";:PRINT USING PAT1$;OP
- 17170 PRINT "Annual depreciation rate ";:PRINT USING PAT3$;ADR;:PRINT " %"
- 17180 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 17190 PRINT
- 17200 COLOR 15,0
- 17210 PRINT "The salvage value is ";:PRINT USING PAT1$;SV
- 17220 COLOR 7,0
- 17230 PRINT
- 17240 PRINT PR1$
- 17250 PRINT
- 17260 PRINT "1 - Change original price"
- 17270 PRINT "2 - Change annual depreciation rate"
- 17280 PRINT "3 - Change number of periods per year"
- 17290 PRINT "4 - Change time period"
- 17300 PRINT "5 - Rerun using all new values"
- 17310 PRINT "6 - Return to main menu"
- 17320 PRINT
- 17330 PRINT PR2$
- 17340 C=VAL(INKEY$)
- 17350 IF C<1 OR C>6 GOTO 17340
- 17360 ON C GOTO 17040,17060,17080,17100,610,330
- 19000 PRINT "This program determines the present value of a coupon"
- 19010 PRINT "bond given the face amount, periodic payment, annual"
- 19020 PRINT "interest rate, number of periods per year and the"
- 19030 PRINT "time period of the bond"
- 19040 PRINT
- 19050 INPUT "Face amount, in dollars $ ",FV
- 19060 IF C=1 GOTO 19170
- 19070 PRINT IN5$;:INPUT "",PMT
- 19080 IF C=2 GOTO 19170
- 19090 PRINT IN3$;:INPUT "",AIR
- 19100 IF C=3 GOTO 19160
- 19110 PRINT IN4$;:INPUT "",NPPY
- 19120 IF C=4 GOTO 19150
- 19130 PRINT PR3$
- 19140 PRINT IN6$;:INPUT "",YY,MM,DD
- 19150 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 19160 IR=AIR/(NPPY*100)
- 19170 PV=PMT*(1-(1+IR)^(-NP))/IR+FV/(1+IR)^(NP)
- 19180 CLS
- 19190 PRINT PR10$;:PRINT USING PAT1$;FV
- 19200 PRINT PR16$;:PRINT USING PAT1$;PMT
- 19210 PRINT PR11$;:PRINT USING PAT3$;AIR;:PRINT " %"
- 19220 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 19230 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 19240 PRINT
- 19250 COLOR 15,0
- 19260 PRINT PR9$;:PRINT USING PAT1$;PV
- 19270 COLOR 7,0
- 19280 PRINT
- 19290 PRINT PR1$
- 19300 PRINT
- 19310 PRINT "1 - Change future value"
- 19320 PRINT "2 - Change periodic payment"
- 19330 PRINT "3 - Change annual interest rate"
- 19340 PRINT "4 - Change number of periods per year"
- 19350 PRINT "5 - Change time period"
- 19360 PRINT "6 - Rerun using all new values"
- 19370 PRINT "7 - Return to main menu"
- 19380 PRINT
- 19390 PRINT PR2$
- 19400 C=VAL(INKEY$)
- 19410 IF C<1 OR C>7 GOTO 19400
- 19420 ON C GOTO 19050,19070,19090,19110,19130,610,330
- 20000 PRINT "This program determines the yield to maturity on
- 20010 PRINT "a bond given the current purchase price. This is
- 20020 PRINT "the true rate of return on a bond.
- 20030 PRINT
- 20040 PRINT IN1$;:INPUT "",PV
- 20050 IF C=1 GOTO 20150
- 20060 PRINT IN2$;:INPUT "",FV
- 20070 IF C=2 GOTO 20150
- 20080 PRINT IN5$;:INPUT "",PMT
- 20090 IF C=3 GOTO 20150
- 20100 PRINT IN4$;:INPUT "",NPPY
- 20110 IF C=4 GOTO 20140
- 20120 PRINT PR3$
- 20130 PRINT IN6$;:INPUT "",YY,MM,DD
- 20140 NP=CINT(NPPY*(YY+MM/12+DD/365.25))
- 20150 IR=0.08/NPPY
- 20160 PF=FV/(1+IR)^NP
- 20170 T=(1+IR)^(-NP):T=1-T:T=T/IR*PMT
- 20180 I1=IR*(PF+T)/PV
- 20190 LOCATE 25,1
- 20200 PRINT USING PAT4$;ABS(IR-I1);
- 20210 IF ABS(IR-I1)>9.99E-07 THEN IR=I1:GOTO 20160
- 20220 AIR=IR*NPPY*100
- 20230 CLS
- 20240 PRINT PR9$;:PRINT USING PAT1$;PV
- 20250 PRINT PR10$;:PRINT USING PAT1$;FV
- 20260 PRINT PR16$;:PRINT USING PAT1$;PMT
- 20270 PRINT PR12$;:PRINT USING PAT2$;NPPY
- 20280 PRINT PR4$;YY;PR5$;MM;PR6$;DD;PR7$;NP;PR8$
- 20290 PRINT
- 20300 COLOR 15,0
- 20310 PRINT "Yield to maturity is ";:PRINT USING PAT3$;AIR;:PRINT " %"
- 20320 COLOR 7,0
- 20330 PRINT
- 20340 PRINT PR1$
- 20350 PRINT
- 20360 PRINT "1 - Change purchase price"
- 20370 PRINT "2 - Change future value"
- 20380 PRINT "3 - Change periodic payment"
- 20390 PRINT "4 - Change number of periods per year"
- 20400 PRINT "5 - Change time period"
- 20410 PRINT "6 - Rerun using all new values"
- 20420 PRINT "7 - Return to main menu"
- 20430 PRINT
- 20440 PRINT PR2$
- 20450 C=VAL(INKEY$)
- 20460 IF C<1 OR C>7 GOTO 20450
- 20470 ON C GOTO 20040,20060,20080,20100,20120,610,330
-